In data communications, flow control is the process of managing the rate of data transmission between two nodes to prevent a faster sender from outrunning a slower receiver. It provides a mechanism for the receiver to control the transmission speed, so that the receiving node is not overwhelmed with data from transmitting node. Flow control is important because it is possible for a sending computer to transmit information at a faster rate than the destination computer can receive and process the information. This can happen if the receiving computers have a heavy traffic load in comparison to the sending computer, or if the receiving computer has less processing power or less memory resources than the sending computer.
Target ports utilize queue depth to control data flow between initiators and the target port. Queue depth is the number of I/O requests a target port can allocate to an initiator. When a new I/O request is received from an initiator, the target increments the queue depth. When the target completes an I/O request, the target decrements the queue depth. There is a maximum queue depth for each target port, and the target device allocates a maximum initiator queue depth to each initiator. When the maximum initiator queue depth is reached, the target returns a queue full status to the initiator. Queue full indicates the target port cannot process more I/O requests from the initiator until one or more queued I/O requests from the initiator have completed.
The iSCSI protocol utilizes flow control to regulate data communication traffic between initiators and targets. The iSCSI protocol, flow control, and related issues are defined in the following documents copyrighted by the Internet Society, and incorporated by reference into the present specification:                RFC2914 “Congestion control principles”        RFC3720 “iSCSI transport protocol description”        RFC3721 “iSCSI naming and discovery”        RFC3723 “Securing block storage protocols over IP”        RFC3347 “iSCSI requirements and design considerations”        
The iSCSI protocol utilizes a command sequence number (CmdSN) and a maximum command sequence number (MaxcmdSN) to implement flow control between each initiator and target. The initiator transfers CmdSN to the target, and the target responds with MaxcmdSN to the initiator.
CmdSN is the current command Sequence Number, advanced by 1 on each command shipped except for commands marked for immediate delivery. CmdSN always contains the number to be assigned to the next Command PDU. CmdSN enables ordered delivery across multiple connections in a single session. CmdSN is either the initial command sequence number of a session (for the first login request of a session—the “leading” login), or the command sequence number in the command stream if the login is for a new connection in an existing session.
MaxcmdSN is the maximum number to be shipped, and is given to the initiator by the target. For non-immediate commands, the CmdSN field can take any value from the previous value of CmdSN to MaxCmdSN. The target must silently ignore any non-immediate command outside of this range or non-immediate duplicates within the range.